#include<stdio.h>
#include<string.h>
int main()
{
    char s[]="A123X456Y7A,302ATB567BC";
    int tot=0;
    char *p=s;
    while(*p){
        while(*p&&!isdigit(*p))p++;
        while(*p&&isdigit(*p))putchar(*p),p++;
        putchar(' ');
        ++tot;
    }
    printf("\n%d\n",tot);

    return 0;
}
